<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style type="text/css">
body{margin:0;}
ul{margin:0; padding:0; list-style:none;}
li{width:200px; margin-right:15px; height:40px; position:relative; float:left;}
input{width:200px; height:40px;}
div{position:absolute; width:100%; height:0; left:0; top:40px; background-color:yellow; overflow:hidden; transition:1.2s all linear;}
.height{height:200px;}
ul:after{content:""; display:block; clear:both;}
</style>
</head>
<body>
<ul>
	<li>
    	<input type="button" value="导航1"/>
        <div>导航1的下拉框</div>
    </li>
    <li>
    	<input type="button" value="导航2"/>
        <div>导航2的下拉框</div>
    </li>
    <li>
    	<input type="button" value="导航3"/>
        <div>导航3的下拉框</div>
    </li>
</ul>
<script>
var aLi = document.getElementsByTagName("li");
/*for(var i=0;i<aLi.length;i++){
	aLi[i].onmouseover = function (){
		this.getElementsByTagName("div")[0].style.display = "block";
	}
	aLi[i].onmouseout = function (){
		this.getElementsByTagName("div")[0].style.display = "none";
	}
}*/
for(var i=0;i<aLi.length;i++){
	aLi[i].onmouseover = function (){
		this.getElementsByTagName("div")[0].className = "height";
	}
	aLi[i].onmouseout = function (){
		this.getElementsByTagName("div")[0].className = "";
	}
}
</script>
</body>
</html>
